Skip to content

Conversation

@abravalheri
Copy link
Contributor

Summary of changes

As stated in #2698, exposing distutil.errors via the setuptools module might facilitate people that want to tackle the migration motivated by PEP 632.

These exceptions might appear when customising commands like build_py and build_ext, and there are examples of projects explicitly checking them in the original issue.

This PR re-exports most of these functions via setuptools.errors.

DistutilsGetoptError and DistutilsArgError are left out, since they are related to the deprecated practice of running the setup.py script directly (I think).

I also removed the "Distutils" part of the name of some exceptions and added notes about the migration/replacements in the docs.

Closes #2698

Pull Request Checklist

As mentioned in pypa#2698, exposing distutil errors via setuptools help the
migration stated by PEP 632.
@abravalheri abravalheri marked this pull request as ready for review November 5, 2021 19:52
@jaraco jaraco merged commit 8af23a4 into pypa:main Nov 7, 2021
@abravalheri
Copy link
Contributor Author

Thank you very much for the review and improvements!

@grlee77
Copy link

grlee77 commented Nov 7, 2021

Thank you for doing this @abravalheri!

ods pushed a commit to aio-libs/aiokafka that referenced this pull request Dec 31, 2021
* Fix doc building

#804 removed the
`aiokafka.protocol.produce` stubs imported from `kafka-python`, this
caused the documentation to fail to build.

* Fix RTD doc compilation

#810 imports errors from
`setuptools` instead of `distutils`

This is available only starting from `setuptools` v59.0.0
(pypa/setuptools#2858) but RTD currently
defaults to v58.2.0
(https://docs.readthedocs.io/en/stable/builds.html#python)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FR] distutils.errors.* is not fully re-exported

3 participants